package com.quartet.modules.service.dao;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.quartet.modules.service.dto.TServiceClickCountDto;
import com.quartet.modules.service.entity.TServiceClickCount;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDateTime;
import java.util.List;

/**
 * (TServiceClickCount)表数据库访问层
 *
 * @author makejava
 * @since 2021-08-09 11:09:15
 */
public interface TServiceClickCountDao extends BaseMapper<TServiceClickCount> {

    /**
     * 功能描述: 查询全部的服务的点击次数
     * @author huipanxing huipanxing@chinasofti.com
     * @date 2021/8/9 11:42
     * @param startLocalDateTime
     * @return java.util.List<com.quartet.modules.service.dto.TServiceClickCountDto>
     */
//    @Select("select time,sum(count) as count from t_service_click_count group by time")
    List<TServiceClickCountDto> queryServiceClickTotalCount(@Param("startLocalDateTime") LocalDateTime startLocalDateTime);

    /**
     * 功能描述: 按照服务类型查询全部的服务的点击次数
     * @author huipanxing huipanxing@chinasofti.com
     * @date 2021/8/9 11:56
     * @param
     * @return java.util.List<com.quartet.modules.service.dto.TServiceClickCountDto>
     */
    List<TServiceClickCountDto> queryServiceClickGroupCount(@Param("localDateTime") LocalDateTime localDateTime);

    /**
     * 功能描述: 查询所有的点击次数
     * @author huipanxing huipanxing@chinasofti.com
     * @date 2021/8/10 14:12
     * @param
     * @return int
     */
    @Select("select sum(count) from t_service_click_count")
    Integer queryServiceClickTotalNum();

    /**
     * 功能描述: 查询24小时内服务点击次数
     * @author huipanxing huipanxing@chinasofti.com
     * @date 2021/8/10 14:12
     * @param startLocalDateTime
     * @return int
     */
    List<TServiceClickCountDto> queryServiceClickCount24Hour(@Param("startLocalDateTime") LocalDateTime startLocalDateTime);
}